
Namespace Utility

    Public NotInheritable Class Helpers

#Region " Constructors "

        Private Sub New()
        End Sub

#End Region

#Region " Methods "

        Public Shared Function GetLowestInnerException(ByVal ex As Exception) As Exception

            If ex.InnerException Is Nothing Then
                Return ex
            End If

            Dim exInner As Exception = ex.InnerException

            Do

                If exInner.InnerException IsNot Nothing Then
                    exInner = exInner.InnerException

                Else
                    Return exInner
                End If

            Loop

        End Function

#End Region

    End Class

End Namespace
